package net.mimai.vultrue.bus.enums;

import net.mimai.vultrue.framework.utils.JudgeUtils;


/**
 *  付款类型
 */
public enum FinType {
    PRE(1,"预付款"),
    AFT(2,"后付款")
    ;
    int key;
    String desc;

    FinType(int key, String desc) {
        this.key = key;
        this.desc = desc;
    }

    public int getKey() {
        return key;
    }

    public void setKey(int key) {
        this.key = key;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static Boolean isMember(int key){
        FinType[] vs= FinType.values();
        for(FinType h:vs){
            if(JudgeUtils.equals(key,h.getKey())){
                return true;
            }
        }
        return false;
    }

    public static FinType getByKey(int key){
        FinType[] vs= FinType.values();
        for(FinType h:vs){
            if(JudgeUtils.equals(key,h.getKey())){
                return h;
            }
        }
        return null;
    }
}
